Optimal. Leaf size=37 \[ \frac {a \tanh ^{-1}(\sin (c+d x))}{d}-\frac {a \cot (c+d x)}{d}-\frac {a \csc (c+d x)}{d} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.08, antiderivative size = 37, normalized size of antiderivative = 1.00, number of steps
used = 7, number of rules used = 7, integrand size = 19, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.368, Rules used = {3957, 2917,
2701, 327, 213, 3852, 8} \begin {gather*} -\frac {a \cot (c+d x)}{d}-\frac {a \csc (c+d x)}{d}+\frac {a \tanh ^{-1}(\sin (c+d x))}{d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 8
Rule 213
Rule 327
Rule 2701
Rule 2917
Rule 3852
Rule 3957
Rubi steps
\begin {align*} \int \csc ^2(c+d x) (a+a \sec (c+d x)) \, dx &=-\int (-a-a \cos (c+d x)) \csc ^2(c+d x) \sec (c+d x) \, dx\\ &=a \int \csc ^2(c+d x) \, dx+a \int \csc ^2(c+d x) \sec (c+d x) \, dx\\ &=-\frac {a \text {Subst}(\int 1 \, dx,x,\cot (c+d x))}{d}-\frac {a \text {Subst}\left (\int \frac {x^2}{-1+x^2} \, dx,x,\csc (c+d x)\right )}{d}\\ &=-\frac {a \cot (c+d x)}{d}-\frac {a \csc (c+d x)}{d}-\frac {a \text {Subst}\left (\int \frac {1}{-1+x^2} \, dx,x,\csc (c+d x)\right )}{d}\\ &=\frac {a \tanh ^{-1}(\sin (c+d x))}{d}-\frac {a \cot (c+d x)}{d}-\frac {a \csc (c+d x)}{d}\\ \end {align*}
________________________________________________________________________________________
Mathematica [C] Result contains higher order function than in optimal. Order 5 vs. order 3 in
optimal.
time = 0.02, size = 41, normalized size = 1.11 \begin {gather*} -\frac {a \cot (c+d x)}{d}-\frac {a \csc (c+d x) \, _2F_1\left (-\frac {1}{2},1;\frac {1}{2};\sin ^2(c+d x)\right )}{d} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.10, size = 42, normalized size = 1.14
method | result | size |
derivativedivides | \(\frac {a \left (-\frac {1}{\sin \left (d x +c \right )}+\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )\right )-a \cot \left (d x +c \right )}{d}\) | \(42\) |
default | \(\frac {a \left (-\frac {1}{\sin \left (d x +c \right )}+\ln \left (\sec \left (d x +c \right )+\tan \left (d x +c \right )\right )\right )-a \cot \left (d x +c \right )}{d}\) | \(42\) |
norman | \(-\frac {a}{d \tan \left (\frac {d x}{2}+\frac {c}{2}\right )}+\frac {a \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{d}-\frac {a \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{d}\) | \(54\) |
risch | \(-\frac {2 i a}{d \left ({\mathrm e}^{i \left (d x +c \right )}-1\right )}-\frac {a \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right )}{d}+\frac {a \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right )}{d}\) | \(59\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.27, size = 50, normalized size = 1.35 \begin {gather*} -\frac {a {\left (\frac {2}{\sin \left (d x + c\right )} - \log \left (\sin \left (d x + c\right ) + 1\right ) + \log \left (\sin \left (d x + c\right ) - 1\right )\right )} + \frac {2 \, a}{\tan \left (d x + c\right )}}{2 \, d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 3.93, size = 63, normalized size = 1.70 \begin {gather*} \frac {a \log \left (\sin \left (d x + c\right ) + 1\right ) \sin \left (d x + c\right ) - a \log \left (-\sin \left (d x + c\right ) + 1\right ) \sin \left (d x + c\right ) - 2 \, a \cos \left (d x + c\right ) - 2 \, a}{2 \, d \sin \left (d x + c\right )} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} a \left (\int \csc ^{2}{\left (c + d x \right )} \sec {\left (c + d x \right )}\, dx + \int \csc ^{2}{\left (c + d x \right )}\, dx\right ) \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.62, size = 50, normalized size = 1.35 \begin {gather*} \frac {a \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1 \right |}\right ) - a \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1 \right |}\right ) - \frac {a}{\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )}}{d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 0.96, size = 29, normalized size = 0.78 \begin {gather*} \frac {a\,\left (2\,\mathrm {atanh}\left (\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )-\mathrm {cot}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\right )}{d} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________